#include <map>

#include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Verifier.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopedHashTable.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/raw_ostream.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "myDialect/toyDialect.h"
#include "myDialect/toyOps.h"
#include "myDialect/toyTypes.h"

int main(){
    using namespace mlir;
    MLIRContext context;
    context.getOrLoadDialect<toy::ToyDialect>();
    context.getOrLoadDialect<arith::ArithDialect>();
    auto builder = OpBuilder(&context);
    auto theModule = ModuleOp::create(builder.getUnknownLoc());
    builder.setInsertionPointToEnd(theModule.getBody());


    auto int32Type = builder.getIntegerType(32);
    auto c10 = builder.create<arith::ConstantOp>(builder.getUnknownLoc(), builder.getIntegerAttr(int32Type, 10));
    auto c12 = builder.create<arith::ConstantOp>(builder.getUnknownLoc(), builder.getIntegerAttr(int32Type, 12));
    auto add_c = builder.create<arith::AddIOp>(builder.getUnknownLoc(), c10, c12);
    theModule->dump();
    return 0;
}
